<div class="nav-sub w1180">
	<ul class="zoom">
		<li><a class="on">编辑商户</a></li>
		<li><a href="/crm/org/list">商户列表</a></li>
		<li><a href="/crm/org/goods-list">商品列表</a></li>
<!-- 		<li><a href="/crm/org/sell-goods">销售商品管理</a></li> -->
	</ul>
</div>
<div class="main-ct w1180">
	<a href="javascript:history.go(-1);" class="btn-cs btn-blue btn-fillet mt10">返 回</a>
<form id="commonForm" method="post" action="/crm/org/update">
	<input type="hidden" name="org_id" value="<?php echo $this->org['org_id'];?>">
	<div class="form-info mt20">
		<dl>
			<dt>商户类型：</dt>
			<dd>
			<label class="mr20"><input type="radio" name="org_type" value="1" <?php if($this->org['org_type'] == 1):?> checked="checked" <?php endif;?>> 配餐类</label>
			<label class="mr20"><input type="radio" name="org_type" value="2" <?php if($this->org['org_type'] == 2):?> checked="checked" <?php endif;?>> 商城类</label>
			</dd>
		</dl>
		<dl>
			<dt>是否直营：</dt>
			<dd>
			<label class="mr20"><input type="radio" name="org_is_direct_sale" value="1" <?php if($this->org['org_is_direct_sale'] == 1):?> checked="checked" <?php endif;?>> 非直营</label>
			<label class="mr20"><input type="radio" name="org_is_direct_sale" value="2" <?php if($this->org['org_is_direct_sale'] == 2):?> checked="checked" <?php endif;?>> 直营</label>
			</dd>
		</dl>
		
		<dl>
			<dt>商户所属分类：</dt>
			<dd>
			<select name="catalog_id">
				<?php if ($this->catalog):?>
    			<?php foreach ($this->catalog as $k=>$v):?>
    			
    				<?php if($this->org['catalog_id'] == $v['catalog_id']):?>
                          <option selected value="<?php echo $this->org['catalog_id'];?>"><?php echo $v['catalog_name']; ?></option>
                    <?php else:?>
                          <option value="<?php echo $v['catalog_id']; ?>"><?php echo $v['catalog_name']; ?></option>
                    <?php endif;?>
        			
        		<?php endforeach; ?>
        		<?php else:?>
        			<option value="">请选择</option>
    			<?php endif;?>
			</select>
			</dd>
		</dl>
		
		<dl>
			<dt>商户名称：</dt>
			<dd><input type="text" class="txt" name="org_name" value="<?php echo $this->org['org_name'];?>"></dd>
		</dl>
		
		<dl>
			<dt>商户主标题：</dt>
			<dd><input type="text" class="txt" name="org_title" value="<?php echo $this->org['org_title'];?>"></dd>
		</dl>
		
		<dl>
			<dt>商户副标题：</dt>
			<dd><input type="text" class="txt" name="org_subtitle" value="<?php echo $this->org['org_subtitle'];?>"></dd>
		</dl>
		
		<dl>
			<dt>商户简介：</dt>
			<dd><textarea type="text" name="org_description"><?php echo $this->org['org_description'];?></textarea></dd>
		</dl>
		
		<dl>
			<dt>商户特色：</dt>
			<dd><textarea type="text" name="org_features"><?php echo $this->org['org_features'];?></textarea></dd>
		</dl>
		
		<dl>
			<dt>商户公告：</dt>
			<dd><input type="text" class="txt" name="org_advice" value="<?php echo $this->org['org_advice'];?>"></dd>
		</dl>
		
		<dl>
			<dt>商户卫生等级：</dt>
			<dd>
			<label class="mr20"><input type="radio" name="org_level" value="1"  <?php if($this->org['org_level'] == 1):?> checked="checked" <?php endif;?>> A</label>
			<label class="mr20"><input type="radio" name="org_level" value="2" <?php if($this->org['org_level'] == 2):?> checked="checked" <?php endif;?>> B</label>
			<label class="mr20"><input type="radio" name="org_level" value="3" <?php if($this->org['org_level'] == 3):?> checked="checked" <?php endif;?>> C</label>
			<label><input type="radio" name="org_level" value="4" <?php if($this->org['org_level'] == 4):?> checked="checked" <?php endif;?>> D</label>
			</dd>
		</dl>
		
		<dl>
			<dt>商户直播开关：</dt>
			<dd>
			<label class="mr20"><input type="radio" name="org_is_open" value="1" <?php if($this->org['org_is_open'] == 1):?> checked="checked" <?php endif;?>> 开启</label>
			<label class="mr20"><input type="radio" name="org_is_open" value="0" <?php if($this->org['org_is_open'] == 0):?> checked="checked" <?php endif;?>> 关闭</label>
		</dl>
		
		<dl>
			<dt>厨房直播链接：</dt>
			<dd><input type="text" class="txt" name="org_live" value="<?php echo $this->org['org_live'];?>"></dd>
		</dl>
		
		<dl>
			<dt>下次直播预告：</dt>
			<dd><textarea class="txt" name="org_next_notice"><?php echo $this->org['org_next_notice'];?></textarea></dd>
		</dl>
		
		<dl>
			<dt>联系人：</dt>
			<dd><input type="text" class="txt" name="org_contact_name" value="<?php echo $this->org['org_contact_name'];?>"></dd>
		</dl>
		
		<dl>
			<dt>商户地址：</dt>
			<dd><textarea  class="txt" name="org_address" id=""><?php echo $this->org_address['address_name'];?></textarea></dd>
		</dl>
		
		<dl>
			<dt>地址图片：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-address_img">
						<img src="<?php if($this->org_address['address_img']):?><?php echo $this->org_address['address_img'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-address_img">
						<input type="hidden" name="address_img" id="address_img" value="<?php echo $this->org_address['address_img'];?>">
					</div>
					<?php if($this->org_address['address_img']):?>
						<a class="btn-del" id="del-address_img" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-address_img" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		<!-- 商户资质 图片 -->
		
		<dl>
			<dt>营业执照：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img1">
						<img src="<?php if($this->org['org_img1']):?><?php echo $this->org['org_img1'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img1">
						<input type="hidden" name="org_img1" id="org_img1" value="<?php echo $this->org['org_img1'];?>">
					</div>
					<?php if($this->org['org_img3']):?>
						<a class="btn-del" id="del-org_img1" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img1" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		<dl>
			<dt>税务登记证：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img2">
						<img src="<?php if($this->org['org_img2']):?><?php echo $this->org['org_img2'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img2">
						<input type="hidden" name="org_img2" id="org_img2" value="<?php echo $this->org['org_img2'];?>">
					</div>
					<?php if($this->org['org_img3']):?>
						<a class="btn-del" id="del-org_img2" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img2" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		<dl>
			<dt>组织机构代码证：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img3">
						<img src="<?php if($this->org['org_img3']):?><?php echo $this->org['org_img3'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img3">
						<input type="hidden" name="org_img3" id="org_img3" value="<?php echo $this->org['org_img3'];?>">
					</div>
					<?php if($this->org['org_img3']):?>
						<a class="btn-del" id="del-org_img3" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img3" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		<dl>
			<dt>食品经营许可证：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img4">
						<img src="<?php if($this->org['org_img4']):?><?php echo $this->org['org_img4'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img4">
						<input type="hidden" name="org_img4" id="org_img4" value="<?php echo $this->org['org_img4'];?>">
					</div>
					<?php if($this->org['org_img4']):?>
						<a class="btn-del" id="del-org_img4" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img4" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		
		<dl>
			<dt>食品流通许可证：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img5">
						<img src="<?php if($this->org['org_img5']):?><?php echo $this->org['org_img5'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img5">
						<input type="hidden" name="org_img5" id="org_img5" value="<?php echo $this->org['org_img5'];?>">
					</div>
					<?php if($this->org['org_img5']):?>
						<a class="btn-del" id="del-org_img5" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img5" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		<dl>
			<dt>餐饮服务食品安全等级：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img6">
						<img src="<?php if($this->org['org_img6']):?><?php echo $this->org['org_img6'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img6">
						<input type="hidden" name="org_img6" id="org_img6" value="<?php echo $this->org['org_img6'];?>">
					</div>
					<?php if($this->org['org_img6']):?>
						<a class="btn-del" id="del-org_img6" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img6" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
		
		<dl>
			<dt>食品安全管理体系认证：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover-org_img7">
						<img src="<?php if($this->org['org_img7']):?><?php echo $this->org['org_img7'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_img7">
						<input type="hidden" name="org_img7" id="org_img7" value="<?php echo $this->org['org_img7'];?>">
					</div>
					<?php if($this->org['org_img7']):?>
						<a class="btn-del" id="del-org_img7" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_img7" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>
		
        
		<dl>
			<dt>商户logo：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add" id="">
					<div class="g-img-ct"  id="cover">
						<img src="<?php if($this->org['org_logo']):?><?php echo $this->org['org_logo'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_logo">
						<input type="hidden" name="org_logo" id="org_logo" value="<?php echo $this->org['org_logo'];?>">
					</div>
					<?php if($this->org['org_logo']):?>
						<a class="btn-del" id="del-org_logo" style="display:none"></a>
					<?php else:?>
						<a class="btn-del" id="del-org_logo" style="display:none"></a>
					<?php endif;?>
				</div>
			</dd>
		</dl>

		<dl>
			<dt>商户图片(列表)：</dt>			
			<dd class="goods-list">
				<div class="goods-img goods-img-add" id="">
					<div class="g-img-ct"  id="cover-thumb_image">
						<img src="<?php if($this->org['org_thumb_image']):?><?php echo $this->org['org_thumb_image'];?><?php else:?>/images/ico/ico-add.png<?php endif;?>"  id="add-org_thumb_image">
						<input type="hidden" name="org_thumb_image" id="org_thumb_image" value="<?php echo $this->org['org_thumb_image'];?>">
					</div>
					<?php if($this->org['org_thumb_image']):?>
						<a class="btn-del del-one-img" id="del-org_thumb_image" style="display:none"></a>
					<?php else:?>
						<a class="btn-del del-one-img" id="del-org_thumb_image" style="display:none"></a>
					<?php endif;?>
					
				</div>
			</dd>
		</dl>
		
        
         <dl>
			<dt>是否显示：</dt>
			<dd>
			<label class="mr20"><input type="radio" name="org_is_display" value="1" <?php if($this->org['org_is_display'] == 1):?> checked="checked" <?php endif;?>> 显示</label>
			<label class="mr20"><input type="radio" name="org_is_display" value="0" <?php if($this->org['org_is_display'] == 0):?> checked="checked" <?php endif;?>> 不显示</label>
			</dd>
		</dl>
		
		<dl>
			<dt>其它：</dt>
			<dd><textarea  class="txt" name="org_other"><?php echo $this->org['org_other'];?></textarea></dd>
		</dl>
		
		<!-- 商户展示图片（多张） org_details -->
		<dl>
			<dt>商户展示图片：</dt>
			<dd class="goods-list" id="show-org_details">
			
			<div class="goods-img goods-img-add">
					<div class="g-img-ct"  id="cover_org_details">
						<img src="/images/ico/ico-add.png">
					</div>
			</div>
				<?php if(!empty($this->org_details)):?>
				<?php foreach ($this->org_details as $k => $v) : ?>
					<div class="goods-img goods-img-add">
						<div class="g-img-ct">
					    	<img src="<?php echo $v;?>">
					    	<input type="hidden" name="<?php echo $k;?>" value="<?php echo $v;?>">
						</div>
						<a class="btn-del" id="del-org_logo"></a>
					</div>
				<?php endforeach; ?>	
				<?php endif;?>
			</dd>
		</dl>
	
		
	</div>
	<p class="mt30 txt-center">
		<input class="input-cs btn-fillet btn-green" type="submit" value="确定" />
	</p>
</form>
</div>

<script type="text/javascript" src="/plugins/webUpload/webuploader.js"></script>
<script type="text/javascript">
var orgDetailsUploader = WebUploader.create({
        	// 选完文件后，是否自动上传。
        	fileNumLimit: 8,
        	auto: true,
        	duplicate:1,
        	swf:'/plugins/webUpload/Uploader.swf',
        	server: '/crm/shop/ajax-upload',
        	pick: {
        		id:'#cover_org_details',
        		multiple:true
        	},
        	formData :{
        		path:"/org",
        	},
        	method :'post',
        	accept: {
        		title: 'Images',
        		extensions: 'gif,jpg,jpeg,png',
        		mimeTypes: 'image/*'
        	}
        });
        
        orgDetailsUploader.on('uploadSuccess',function(file,response){
        	if(response.state == 'SUCCESS'){
        		var html='';
        		html +=	'<div class="goods-img goods-img-add">'
        					+ '<div class="g-img-ct">'
        				    + '<img src="'+ response.url +'">'
        				    + '<input type="hidden" name="'+ file.id +'" value="'+ response.url +'">'
        					+ '</div>'
        					+ '<a class="btn-del" href="javascript:delImg();"></a>'
        					+ '</div>';
        		$('#show-org_details').append(html);
        	}
        });




var addressUploader = WebUploader.create({
        	// 选完文件后，是否自动上传。
        	fileNumLimit: 1,
        	auto: true,
        	duplicate:1,
        	swf:'/plugins/webUpload/Uploader.swf',
        	server: '/crm/shop/ajax-upload',
        	pick: {
        		id:'#cover-address_img',
        		multiple:false
        	},
        	formData :{
        		path:"/org/address",
        	},
        	method :'post',
        	accept: {
        		title: 'Images',
        		extensions: 'gif,jpg,jpeg,png',
        		mimeTypes: 'image/*'
        	}
        });

    	addressUploader.on('uploadSuccess',function(file,response){
        	if(response.state == 'SUCCESS'){
        		$('#add-address_img').attr("src",response.url);
         		$('#address_img').val(response.url);
         		//$('#del-material_supplier_img1').show();
        		
        	}
        });

        
// var uploader1 = WebUploader.create({
//         		// 选完文件后，是否自动上传。
//         		fileNumLimit: 8,
//         		auto: true,
//         		duplicate:1,
//         		swf:'/plugins/webUpload/Uploader.swf',
//         		server: '/crm/product/upload',
//         		pick: {
//         			id:'#cover1',
//         			multiple:true
//         		},
//         		formData :{
//         			path:"/org",
//         		},
//         		method :'post',
//         		accept: {
//         			title: 'Images',
//         			extensions: 'gif,jpg,jpeg,png',
//         			mimeTypes: 'image/*'
//         		}
//         	});
        
        	
//         	uploader1.on('uploadSuccess',function(file,response){
//         		if(response.state == 'SUCCESS'){
//         		var html='';
//         		html +=	'<div class="goods-img goods-img-add">'
// 							+ '<div class="g-img-ct"  id="cover1">'
// 						    + '<img src="'+ response.url +'"  id="add-org_logo1">'
// 						    + '<input type="hidden" name="'+ file.id +'" id="org_logo1" value="'+ response.url +'">'
// 							+ '</div>'
// 							+ '<a class="btn-del" href="javascript:delImg();"></a>'
// 							+ '</div>';
// 				$('#show-org-logo').append(html);
        			
//         		}
//         	});

var uploader = WebUploader.create({
        		auto: true,
        		duplicate:1,
        		swf:'/plugins/webUpload/Uploader.swf',
        		server: '/crm/shop/ajax-upload',
        		pick: {
        			id:'#cover',
        			multiple:true
        		},
        		formData :{
        			path:"/org",
        		},
        		method : 'post',
        		accept: {
        			title: 'Images',
        			extensions: 'gif,jpg,jpeg,png',
        			mimeTypes: 'image/*'
        		}
        	});
        
        	uploader.on('uploadSuccess',function(file,response){
        		//alert(file.id);
        		console.log(file);
        		console.log(response);
        		if(response.state == 'SUCCESS'){
        	 		$('#add-org_logo').attr("src",response.url);
        	 		$('#org_logo').val(response.url);
        	 		//$('#del-org_logo').show();
        			
        		}
        	});

var orgListUploader = WebUploader.create({
        		auto: true,
        		duplicate:1,
        		swf:'/plugins/webUpload/Uploader.swf',
        		server: '/crm/shop/ajax-upload',
        		pick: {
        			id:'#cover-thumb_image',
        			multiple:true
        		},
        		formData :{
        			path:"/org",
        		},
        		method : 'post',
        		accept: {
        			title: 'Images',
        			extensions: 'gif,jpg,jpeg,png',
        			mimeTypes: 'image/*'
        		}
        	});
        
			orgListUploader.on('uploadSuccess',function(file,response){
        		//alert(file.id);
        		console.log(file);
        		console.log(response);
        		if(response.state == 'SUCCESS'){
        	 		$('#add-org_thumb_image').attr("src",response.url);
        	 		$('#org_thumb_image').val(response.url);
        	 		//$('#del-org_thumb_image').show();
        			
        		}
        	});

var uploader1 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img1',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader1.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img1').attr("src",response.url);
	         		$('#org_img1').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });


var uploader2 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img2',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader2.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img2').attr("src",response.url);
	         		$('#org_img2').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });


var uploader3 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img3',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader3.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img3').attr("src",response.url);
	         		$('#org_img3').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });

var uploader4 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img4',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader4.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img4').attr("src",response.url);
	         		$('#org_img4').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });


var uploader5 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img5',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader5.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img5').attr("src",response.url);
	         		$('#org_img5').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });

var uploader6 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img6',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader6.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img6').attr("src",response.url);
	         		$('#org_img6').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });

var uploader7 = WebUploader.create({
	        	// 选完文件后，是否自动上传。
	        	fileNumLimit: 1,
	        	auto: true,
	        	duplicate:1,
	        	swf:'/plugins/webUpload/Uploader.swf',
	        	server: '/crm/shop/ajax-upload',
	        	pick: {
	        		id:'#cover-org_img7',
	        		multiple:false
	        	},
	        	formData :{
	        		path:"/org",
	        	},
	        	method :'post',
	        	accept: {
	        		title: 'Images',
	        		extensions: 'gif,jpg,jpeg,png',
	        		mimeTypes: 'image/*'
	        	}
	        });
	    
	        uploader7.on('uploadSuccess',function(file,response){
	        	if(response.state == 'SUCCESS'){
	        		$('#add-org_img7').attr("src",response.url);
	         		$('#org_img7').val(response.url);
	         		//$('#del-material_supplier_img1').show();
	        		
	        	}
	        });
			
	$(function(){
  	     $(".btn-del").click(function() {
  	    	 $(this).parent("div").remove(); 
  	     });
  	});

	function delImg(){

		$(".btn-del").click(function() {
	    	 $(this).parent("div").remove(); 
	     });
		
	}
	
    $().ready(function() {
    	$("#commonForm").validate({
    		debug:true,
    		rules: {
    			org_name: {
    				required: true
    			},
    			org_title: {
    				required: true
    			},
    			org_subtitle: {
    				required: true
    			},
    			org_features: {
    				required: true
    			},
    			org_advice: {
    				required: true
    			},
    			org_live: {
    				required: true
    			},
    			org_level: {
    				required: true
    			},
    			catalog_id: {
    				required: true
    			},
    			org_contact_name: {
    				required: true
    			},
    			org_address: {
    				required: true
    			},
    			org_description: {
    				required: true
    			},
    			org_logo: {
    				required: true
    			}
    		},
    		submitHandler:function(form){ 
    	            form.submit();
    	    }   
    	});
    
    });


	$(function(){
		$('.btn-add-more').click(function(){
			$('.form-info').append('<dl>'
					+'<dt><input type="text" class="txt-custom txt-custom-s" placeholder="标题自定义"></dt>'
					+'<dd><input type="text" class="txt-custom" placeholder="内容自定义"></dd>'
					+'</dl>');
		})
	})
</script>